package com.yanshibo.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yanshibo.bean.Covo;
import com.yanshibo.bean.Drom;
import com.yanshibo.bean.Floor;
import com.yanshibo.bean.Record;
import com.yanshibo.bean.Student;
import com.yanshibo.bean.Tiaos;
import com.yanshibo.dao.StudentDao;

@Service
public class StudentServiceImpl implements StudentService{
	@Autowired
	private StudentDao dao;

	public Student selUser(Student student) {
		// TODO Auto-generated method stub
		return dao.selStu(student);
	}
	
	public List<Record> selRec(Integer sid) {
		// TODO Auto-generated method stub
		return dao.selRec(sid);
	}
	 
	public PageInfo<Drom> selDrom(Integer pageNum, Integer pageSize, Covo vo) {
		// TODO Auto-generated method stub
		PageHelper.startPage(pageNum, pageSize);
		List<Drom> list = dao.selDrom(vo);
		PageInfo<Drom> info = new PageInfo<Drom>(list);
		return info;
	}
	 
	public Drom selById(Integer id) {
		// TODO Auto-generated method stub
		return dao.selById(id);
	}
	 
	public List<Record> selReById(Integer id) {
		// TODO Auto-generated method stub
		return dao.selReById(id);
	}
	 
	public List<Student> selStu() {
		// TODO Auto-generated method stub
		return dao.selStus();
	}
	 
	public List<Floor> selFloor() {
		// TODO Auto-generated method stub
		return dao.selFloor();
	}
	 
	public List<Drom> selDrom(Integer fid) {
		// TODO Auto-generated method stub
		return dao.selDroms(fid);
	}
	 
	public void tiaos(Tiaos t) {
		// TODO Auto-generated method stub
		//离开原宿舍
		dao.upRe(t);
		//进入新宿舍
		dao.upRes(t);
	}

}
